<?php
include_once '../common_mbs.inc.php';
include_once '../smarty.inc.php';

//判断访问权限
$admin_index_module_obj = new osgh_admin_index_module_cls();
$is_warrant = $admin_index_module_obj->is_have_warrant($_ADMIN_ID,'kefu_list');
if(!$is_warrant) tcmc_cls::ShowMsg("没有权限访问！", "../index_body.html");

$kefu_obj = new kefu_cls();
$act = trim($_INPUT['action']);
$kefu_id  = $_INPUT['kefu_id'];
if($act =='save')
{   
	if(empty($kefu_id)){
		$data = array(
			'kefu_qq' => $_INPUT['kefu_qq'],
			'kefu_des' => $_INPUT['kefu_des'],
		);
		$kefu_obj->add_kefu($data);
		tcmc_cls::ShowMsg("添加客服成功！", "kefu_list.php");
	}else{
		  $up_data = array(
						'kefu_id' => $kefu_id,
						'kefu_qq' => $_INPUT['kefu_qq'],
						'kefu_des' => $_INPUT['kefu_des'],						
					 );
		   $kefu_obj->update_kefu($up_data, $kefu_id);
		   tcmc_cls::ShowMsg("修改客服成功！", "kefu_list.php");
	}
}elseif($act =='del'){
	$kefu_obj->del_kefu($kefu_id);
	tcmc_cls::ShowMsg("删除客服成功！", "kefu_list.php");
}

?>
